package com.thf.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.thf.model.NewsModels;
import com.thf.model.ResultData;
import com.thf.service.NewsService;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class NewsController {

    @Resource
    private NewsService newsService;
    @RequestMapping("/news")
    public ResultData<Page<NewsModels>> findAndPage(@Param("pageNo") Integer pageNo , @Param("pageSize") Integer pageSize){

        //反馈给前端--返回值
        return new ResultData<>(0, newsService.page(new Page<>(pageNo, pageSize)));
    }
}
